package info

import (
	"flag"
	"fmt"
	"os"
)

// Info 项目信息
var Info = struct {
	Name      string
	Version   string
	Author    string
	Project   string
	GitRepo   string
	License   string
	Copyright string
}{
	Name:      "磁盘监控系统",
	Version:   "1.0.3",
	Author:    "liumou_site",
	Project:   "磁盘监控系统",
	GitRepo:   "https://gitee.com/liumou_site/disk-monitoring",
	License:   "MIT",
	Copyright: "Copyright © 2025 坐公交也用券",
}

// ShowVersion 显示版本信息
func ShowVersion() {
	fmt.Printf("%s v%s\n", Info.Name, Info.Version)
	fmt.Printf("作者: %s\n", Info.Author)
	fmt.Printf("项目地址: %s\n", Info.GitRepo)
	fmt.Printf("许可证: %s\n", Info.License)
	fmt.Printf("版权: %s\n", Info.Copyright)
}

// ShowHelp 显示帮助信息
func ShowHelp() {
	fmt.Printf("%s v%s\n", Info.Name, Info.Version)
	fmt.Printf("项目地址: %s\n", Info.GitRepo)
	fmt.Printf("\n使用方法:\n")
	flag.PrintDefaults()
	fmt.Printf("\n服务管理命令:\n")
	fmt.Printf("  --service install    安装系统服务\n")
	fmt.Printf("  --service uninstall  卸载系统服务\n")
	fmt.Printf("  --service update     更新系统服务\n")
}

// ShowStartupInfo 显示启动信息
func ShowStartupInfo() {
	fmt.Printf("=== %s v%s ===\n", Info.Name, Info.Version)
	fmt.Printf("作者: %s\n", Info.Author)
	fmt.Printf("项目地址: %s\n", Info.GitRepo)
	fmt.Printf("许可证: %s\n", Info.License)
	fmt.Printf("\n")
}

// ShowServiceCommands 显示服务命令帮助
func ShowServiceCommands() {
	fmt.Printf("\n服务管理命令:\n")
	fmt.Printf("  install    安装系统服务\n")
	fmt.Printf("  uninstall  卸载系统服务\n")
	fmt.Printf("  update     更新系统服务\n")
	fmt.Printf("\n示例:\n")
	fmt.Printf("  %s --service install\n", os.Args[0])
	fmt.Printf("  %s --service update\n", os.Args[0])
}
